import mongoose from "mongoose";
import { noteSchema } from "./note.js";

const userSchema = mongoose.Schema({
    id: String,
    regid: String,
    password: String,
    tel: String,
    email: String,
    notes: [ noteSchema ],
    isAdmin: { type: Boolean, default: false },
    visits: { type: Number, default: 1 },
    recent_login_date: { type: Date, default: Date.now },
}, {
    timestamps: true
});

const User = mongoose.model("User", userSchema);

export { User }